//
//  NSDate+MGRecently.m
//  MGPolymerAdSDK_Example
//
//  Created by 虞嘉伟 on 2025/1/7.
//  Copyright © 2025 790879770@qq.com. All rights reserved.
  

#import "NSDate+MGRecently.h"

@implementation NSDate (MGRecently)

/**
 *  是否为今天
 */
- (BOOL)isToday {
    NSCalendar *calendar = [NSCalendar currentCalendar];
    return [calendar isDateInToday:self];
}

/**
 *  是否为昨天
 */
- (BOOL)isYesterday {
    NSCalendar *calendar = [NSCalendar currentCalendar];
    return [calendar isDateInYesterday:self];
}


- (NSString *)formatDate:(NSString *)format {
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:format];
    return [formatter stringFromDate:self];
}


@end
